<template>
    <div class="home">
        <!-- <div class="banner-images" v-for="(item,index) in itemList" :key="item.itemid">
            <img v-for="(data,ind) in itemList[index].image_url_set" :key="ind" :src="data['800']" alt="">
        </div> -->
        <!-- <homeitem></homeitem> -->
        <div class="homeitem">
            <div class="updataTime">
                <router-link to="/home/homedata/todayTenNewGoo" tag="span" active-class="active">今日十点上新</router-link>
                <router-link to="/home/homedata/romorTenNewGoos" tag="span" active-class="active">明日十点预告</router-link>
            </div>
        </div>
        <router-view></router-view>
    </div>
</template>
<script>
// import homeitem from './Homeitem'
export default {
    data () {
        return {
        }
    },
    methods: {
        getTimeData () {
            console.log('getlist=======',this.page)
            this.axios({
                url: `/api4/v1/deal/dealactlist?card_id=4057&page=${this.page}&page_key=1583328240&platform=wap&client_v=1.0&user_tag_id=0&source=touch&site=bj`,
                method: 'get',
            }).then(res => {
                console.log(res.data.item_list[0], '============');
                // this.dataList = res.data.item_list
                    if ( res.data.has_more !== '1') {
                        this.dataList.push(...res.data.item_list) // 把数组添加进去
                        this.finished = false
                        this.loading = false
                        if(this.page===8){
                            this.finished = true // 停止触发
                            this.loading = true // 加载完成
                        }
                    }else {
                        console.log('异步请求数据有误')
                    }
            })
        }, // 获取列表数据
        onLoad () {
            console.log('更新');
            this.page++
            this.getTimeData()
            // this.finished = true // 停止触发
            // this.loading = true // 加载完成
            if(this.page===9){
                this.finished = true // 停止触发
                this.loading = true // 加载完成
            }
        }, // 列表更新
    },
    mounted () {
        this.$store.commit('ishide')
    },
    destroyed () {
        this.$store.commit('ishow')
    },
    components:{
    }
}
</script>
<style lang="scss" scoped>
.home{
    .updataTime{
        width: 100%;
        height: 44px;
        display: flex;
        text-align: center;
        line-height: 44px;
        background-color: #fff;
        span{
            flex: 1;
            color: #666;
            font-size: 14px;
        }
        .active{
            color: $e-red;
        }
    }

}
</style>
